Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUGFIX lts] Prevent <base target="_parent"> from erroring in HistoryLocation #19059

Merged
merged 1 commit into from
Jul 29, 2020

Conversation

rwjblue
Copy link
Member

@rwjblue rwjblue commented Jul 29, 2020

It is perfectly valid to have a <base> element without an href attribute but the code previously assumed that if a <base> was present that it must contain an href.

Specifically, prior to this change if you had a <base> like:

<base target="_parent">

You would get the following error:

Uncaught TypeError: Cannot read property 'replace' of null

See on MDN for more details on usage of <base> without an href.

Fixes #19038

…ryLocation

It is perfectly valid to have a `<base>` element without an `href`
attribute but the code previously assumed that if a `<base>` was present
that it **must** contain an `href`.

Specifically, prior to this change if you had a `<base>` like:

```html
<base target="_parent">
```

You would get the following error:

```
Uncaught TypeError: Cannot read property 'replace' of null
```

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base for
more details on usage of `<base>` without an `href`.
@rwjblue rwjblue added the Bug label Jul 29, 2020
@rwjblue rwjblue merged commit dae3aef into master Jul 29, 2020
@rwjblue rwjblue deleted the check-base-href branch July 29, 2020 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Uncaught TypeError when <base> tag doesnt have a href attribute
1 participant